package receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

import application.UIApplication;

/**
 * Created by yanglei on 15/9/26.
 */
public abstract class DownloadStartReceiver extends BroadcastReceiver {
    public static final String Action = UIApplication.PackageName+".Receiver.DownloadStart";
    @Override
    public void onReceive(Context context, Intent intent) {
        if (Action.equals(intent.getAction())){
            String tag = intent.getStringExtra("tag");
            String url = intent.getStringExtra("url");
            DownloadStart(context, intent, url,tag);
        }
    }

    /**
     * 开始下载
     * @param context
     * @param intent
     * @param tag 标识
     */
    public abstract void DownloadStart(Context context, Intent intent,String url,String tag);
}
